package com.example.emos.wx.mapper;

import com.example.emos.wx.entity.TbUser;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.Set;

/**
 * @author kayak
 * @description 针对表【tb_user(用户表)】的数据库操作Mapper
 * @createDate 2024-06-28 15:39:37
 * @Entity com.example.emos.wx.entity.TbUser
 */
@Mapper
public interface TbUserMapper {
    @Select("select if(count(*), true, false ) from tb_user where root = 1")
    public boolean haveRootUser();

    public Integer insert(TbUser tbUser);

    @Select("select * from tb_user where open_id = #{openId} and status = 1")
    public int searchIdByOpenId(String openId);

    public Set<String> searchUserPermissions(int userId);
}




